﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="EM.admin.roles._default" %>

<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="radG" %>
<%@ Register Src="~/Common/PageName.ascx" TagName="PageName" TagPrefix="uc1" %>
<%@ Register Src="~/Common/SectionName.ascx" TagName="SectionName" TagPrefix="uc3" %>
<%@ Register Src="~/Common/Header.ascx" TagName="Header" TagPrefix="uc2" %>
<%@ Register Src="~/Common/Footer.ascx" TagName="Footer" TagPrefix="uc4" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link runat="server" id="linkCss" rel="stylesheet" href="~/css/master.css" type="text/css" />
    <link runat="server" id="linkcssbuttons" rel="stylesheet" href="~/css/buttons.css"
        type="text/css" />
    <script src="../../js/PopUp.js" type="text/javascript"></script>
</head>
<script type="text/javascript">
    var rgMaster;

    var rgMaster;

    function GridCreated() {
        rgMaster = this;
        if (rgMaster.MasterTableView.Rows.length) {
            rgMaster.MasterTableView.SelectRow(rgMaster.MasterTableView.Rows[0].Control, true);
        }
    }
    function btnInsert_OnClick() {
        openWin('Default_edit.aspx?task=Insert&ID=-1', '', 1, 1000, 700);
    }
    function btnUpdate_OnClick(ID) {
        openWin('Default_edit.aspx?task=Update&ID=' + ID, '', 1, 1000, 700);
    }

    function btnDelete_OnClick(ID) {
        openWin('Default_edit.aspx?task=Delete&ID=' + ID, '', 1, 1000, 700);
    }

    </script>
<body>
    <form id="form1" runat="server">
    <table width="100%" height="100%" cellspacing="0" cellpadding="0" border="0">
        <tr>
            <td class="TdMainTop">
                <uc2:Header ID="Header1" runat="server"></uc2:Header>
            </td>
        </tr>
        <tr>
            <td class="TdMainContent" valign="top">
                <table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td class="TdPageName" colspan="2">
                            <uc1:PageName ID="ucPageName" runat="server" PAGEID="7" PAGEWIDTH="700" SHOWBOOKMARKBUTTON="true">
                            </uc1:PageName>
                        </td>
                    </tr>
                    <tr>
                        <td id="TdMainRight" valign="top">
                            <div id="ContentRight">
                                <div id="GrdDivMaster">
                                    <radG:RadGrid ID="rgMaster" runat="server" Skin="master" GridLines="None" PageSize="20"
                                        AllowPaging="True" AllowSorting="True" Width="700" AutoGenerateColumns="False"
                                        EnableAJAX="true" ShowStatusBar="true" LoadingTemplateTransparency="55" EnableAJAXLoadingTemplate="True"
                                        OnNeedDataSource="rgMaster_NeedDataSource" OnItemDataBound="rgMaster_ItemDataBound">
                                        <PagerStyle Mode="NumericPages" />
                                        <ClientSettings Selecting-AllowRowSelect="false">
                                        </ClientSettings>
                                        <MasterTableView GridLines="None" DataKeyNames="ROLEID">
                                            <Columns>
                                                <radG:GridBoundColumn UniqueName="ROLEID" DataField="ROLEID" Visible="false">
                                                </radG:GridBoundColumn>
                                                <radG:GridBoundColumn UniqueName="ROLENAME" DataField="ROLENAME" HeaderText="Rol">
                                                    <HeaderStyle HorizontalAlign="left" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </radG:GridBoundColumn>
                                                <radG:GridBoundColumn UniqueName="STATUS" DataField="STATUS" HeaderText="Durum">
                                                    <HeaderStyle HorizontalAlign="left" Width="100" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </radG:GridBoundColumn>
                                                <radG:GridBoundColumn UniqueName="MAXSESSIONCOUNT" DataField="MAXSESSIONCOUNT" HeaderText="Max. Oturum Sayısı">
                                                    <HeaderStyle HorizontalAlign="left" Width="100" />
                                                    <ItemStyle HorizontalAlign="right" />
                                                </radG:GridBoundColumn>
                                                <radG:GridBoundColumn UniqueName="STARTDATE" DataField="STARTDATE" DataFormatString="{0:dd.MM.yyyy}"
                                                    HeaderText="Başlangıç Tarihi">
                                                    <HeaderStyle HorizontalAlign="left" Width="90" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </radG:GridBoundColumn>
                                                <radG:GridBoundColumn UniqueName="ENDDATE" DataField="ENDDATE" DataFormatString="{0:dd.MM.yyyy}"
                                                    HeaderText="Bitiş Tarihi">
                                                    <HeaderStyle HorizontalAlign="left" Width="90" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </radG:GridBoundColumn>
                                                <radG:GridTemplateColumn UniqueName="Edit">
                                                    <HeaderStyle HorizontalAlign="left" Width="30" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <HeaderTemplate>
                                                        <label class="Grid_Table_Header">
                                                            <asp:Label ID="lblActions" runat="server">İşlemler</asp:Label></label>
                                                    </HeaderTemplate>
                                                    <ItemTemplate>
                                                        <a id="btnEdit" href='javascript:btnUpdate_OnClick(<%#Eval("ROLEID")%>)'>
                                                            Düzenle</a>
                                                    </ItemTemplate>
                                                </radG:GridTemplateColumn>
                                            </Columns>
                                        </MasterTableView>
                                    </radG:RadGrid>
                                    <br />
                                    <div style="width: 700px">
                                        <a id="btnCreate" class="btn_left xp_add" href="javascript:btnInsert_OnClick();">
                                            <strong class="btn_rigth_xp xp">
                                                <asp:Label ID="lblCreate" runat="server">Ekle</asp:Label></strong> </a>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td style="vertical-align: bottom;" class="MasterFooter">
                <uc4:Footer ID="Footer1" runat="server"></uc4:Footer>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
